import java.net.InetAddress;

/**
 * TODO:请描述本类的作用
 * @version 1.0
 * @update 【1】【2021/8/3 10:31】【welkin】【创建】
 */
public class test1 {
    public static void main(String[] args) throws Exception {
        InetAddress addr = InetAddress.getLocalHost();
        System.out.println("Local HostAddress:  " + addr.getHostAddress());
        String hostname = addr.getHostName();
        System.out.println("Local host name: " + hostname);
    }
}
